package com.example.lizhanqi.livevideo.adaputer;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by Lizhanqi on 2016/9/14 0014.
 */
public class TabLayoutAdaputer extends FragmentPagerAdapter {
    Fragment[] fragments;
    String[] titles;

    public TabLayoutAdaputer(FragmentManager fm,Fragment[] fragments,String[] titles) {
        super(fm);
        this.fragments=fragments;
        this.titles=titles;
    }
    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return titles.length;
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
